<%--
    Document   : loancollection
    Created on : Apr 6, 2011, 3:37:32 PM
    Author     : Dine
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<html>
    <head>
        <sj:head jqueryui="true" jquerytheme="south-street" compressed="false"/>
        <jsp:include page="WEB-INF/fragments/globalHead.html"/>
        <title>Cashmate <s:property value="#session.branch.branchname"/> - Loan Release</title>
        <style type="text/css">
            
        </style> <!--main.jsp css-->
        <script type="text/javascript">
            
        </script> <!--main.jsp script-->
    </head>
    <body>

        <c:if test="${sessionScope.auth == null || sessionScope.auth == false}">
            <%--<jsp:forward page="index.jsp?auth=none"/>--%>
        </c:if>
        <s:div id="bodyContainer">
            <s:div id="logoContainer" cssClass="ui-widget-content ui-corner-all">
                <s:include value="WEB-INF/fragments/banner.jsp">
                    <s:param name="branch" value="#session.branch.branchname" />
                </s:include>
            </s:div>
            <jsp:include page="WEB-INF/fragments/top.jsp"/>
            <jsp:include page="WEB-INF/fragments/mainMenu.jsp?menu=Loan"/>
            <jsp:include page="WEB-INF/fragments/left.jsp?type=loan&innerType=loanrelease&select1=subMenuLoanRelease&select2=loanApprovalSubMenu_${param.cat}"/>

            <s:div id="contentContainer" cssClass="ui-widget-content ui-corner-all">
                <h1 id="contentHeader" class="ui-state-default ui-corner-all"></h1>
                <s:div id="theContent">
                <s:action name="query-privilege2" var="privilege" executeResult="false">
                    <s:param name="pagename" value="loanrelease.jsp"/>
                    <s:param name="moduleid" value="7"/>
                </s:action>
                <s:if test='%{!#privilege.viewable && #status != "nonviewable"}'>
                    <script type="text/javascript">
                        window.location.href = "loanrelease.jsp?status="+escape("nonviewable");
                    </script>
                </s:if>        
                <s:elseif test="%{!#privilege.viewable && #parameters.status == null}">
                    <script type="text/javascript">
                        window.location.href = "loanrelease.jsp?status="+escape("nonviewable");
                    </script>
                </s:elseif>

                <s:if test='%{#status == "nonviewable"}'>
                                <s:include value="WEB-INF/error/unauthorized.html"/>
                </s:if>
                <s:else>
                    
                    <c:if test="${param.cat == 'voucher'}">
                        <script type="text/javascript">
                            $('h1#contentHeader').html('<span id="level1">Release Voucher</span>');
                        </script>
                        <jsp:include page="WEB-INF/fragments/voucher.jsp"/>
                    </c:if>
                    <c:if test="${param.cat == 'receipt'}">
                        <script type="text/javascript">
                            $('h1#contentHeader').html('<span id="level1">Print Acknowledgement Receipt</span>');
                        </script>
                        <jsp:include page="WEB-INF/fragments/acknowledgement.jsp"/>
                    </c:if>
            
                </s:else>
                                                              
                </s:div>

            </s:div>
            <jsp:include page="WEB-INF/fragments/bottom.jsp"/>
        </s:div>
    </body>
</html>
